<?php
/**
 * @ClassName: RoleEnum
 * @Description: TODO
 * @author: gydtrade
 * @Date: 2025-09-10 14:06
 * @Version: V1.0.0
 */

namespace app\common\enum;

class RoleEnum
{
    const merchant = 1;//商户
    const store = 2;//门店
    const agent = 3;//代理
    const master = 4;//师傅
    const staff = 5;//员工

    /**
     * 角色类型
     * @param $level
     * @return string|string[]
     */
    public static function RoleTypeText($level)
    {
        $desc = [
            RoleEnum::merchant => '商户',
            RoleEnum::store => '门店',
            RoleEnum::agent => '代理',
            RoleEnum::master => '师傅',
            RoleEnum::staff => '员工',
        ];
        if ($level === true) {
            return $desc;
        }
        return $desc[$level] ?? $level;
    }

}